package com.design.model.decorator;

import java.util.Objects;

/**
 * @program: study
 * @className: Decorator
 * @description: TODO
 * @author: kukuxiahuni
 * @create: 2019-07-18 09:43
 * @version: v1.0
 **/
public abstract class Decorator extends Component {

    protected Component component;

    @Override
    public void operation() {
        if (Objects.nonNull(this.component)) {
            this.component.operation();
        }
    }

    public Component getComponent() {
        return component;
    }

    public void setComponent(Component component) {
        this.component = component;
    }
}

